<template>
  <el-dialog :visible.sync="visible" :close-on-click-modal="false">
    <el-form ref="dataForm" :rules="rules" :model="temp" label-position="right" label-width="80px" style="width: 500px; margin-left:50px;">
        <el-form-item label="投顾名称" prop="investName">
          <el-input v-model="temp.investName" />
        </el-form-item>
        <el-form-item label="联系人" prop="investContacts">
          <el-input v-model="temp.investContacts" />
        </el-form-item>
        <el-form-item label="手机号码" prop="investMobile">
          <el-input v-model="temp.investMobile" />
        </el-form-item>
        <el-form-item label="微信号" prop="investWechat">
          <el-input v-model="temp.investWechat" />
        </el-form-item>
        <el-form-item label="邮箱" prop="investEmail">
          <el-input v-model="temp.investEmail" />
        </el-form-item>
        <el-form-item v-if="dialogStatus==='create'" label="合作意向" prop="investType">
          <el-select v-model="temp.investType" placeholder="请选择投资形式" style="width: 420px;">
            <el-option :label="item.name" :value="item.id" v-for="item in typeList" :key="item.id"></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="渠道来源" prop="investChannel">
          <el-input v-model="temp.investChannel" />
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button @click="visible = false">取消</el-button>
        <el-button type="primary" @click="dialogStatus==='create'?addSubmit():updateSubmit()">提交</el-button>
      </div>
  </el-dialog>
</template>

<script>
export default {
  data() {
    return {
      visible: false,
      temp: {},
      rules: {
        investName: [{ required: true, message: '投顾名称必填', trigger: 'change' }],
        investMobile: [{ required: true, message: '手机号码必填', trigger: 'change' }]
      }
    }
  },
  methods: {
    init() {
      this.visible = true
      this.dataForm.deptId = ''
      this.$nextTick(() => {
        this.$refs['dataForm'].resetFields()
        Promise.all([
          // this.getRoleList()
        ]).then(() => {
          if (this.dataForm.id) {
            this.getInfo()
          }
        })
      })
    },
    addSubmit() {},
    updateSubmit() {},
    getInfo() {}
  }
}
</script>

<style lang="scss" scoped>

</style>
